<include file="default/public/header_mini" />
<div class="reg-form-box">
<div id="errmsg"></div>
<div class="am-form am-form-horizontal">
  <div class="am-form-group">
    <label for="doc-ipt-pwd-2" class="am-u-sm-3 am-form-label">密&nbsp;&nbsp;&nbsp;&nbsp;码：</label>
    <div class="am-u-sm-9">
      <input type="password" id="loginPwd" placeholder="设置一个密码吧">
    </div>
  </div>
  <div class="am-form-group">
    <label for="doc-ipt-pwd-2" class="am-u-sm-3 am-form-label">重复密码：</label>
    <div class="am-u-sm-9">
      <input type="password" id="reUserPwd" placeholder="请重复您的密码">
    </div>
  </div>

  <div class="am-form-group">
    <div class="am-u-sm-9 am-u-sm-offset-3">
      <button class="am-btn am-btn-danger" onClick="rePwd()">确&nbsp;&nbsp;定</button>
    </div>
  </div>
</div>
</div>

<script src="__ROOT__/Apps/Wap/View/default/assets/js/jquery.min.js"></script>
<script src="__ROOT__/Apps/Wap/View/default/assets/js/amazeui.min.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript">
var countdown=60; 
function rePwd(){
   var params = {};
   params.loginPwd = $.trim($('#loginPwd').val());
   params.reUserPwd = $.trim($('#reUserPwd').val());
   if(params.loginPwd==''){
	   $("#errmsg").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请输入密码!");
	   $('#loginPwd').focus();
	   return;
   }
   if(params.reUserPwd==''){
	   $("#errmsg").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;请输入重复密码!");
	   $('#reUserPwd').focus();
	   return;
   }
   if(params.loginPwd != params.reUserPwd){
	   $("#errmsg").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;两次密码不一致!");
	   $('#loginPwd').focus();
	   return;
   }
   $.post("{:U('Wap/Users/rePwd')}",params,function(data,textStatus){
	   var json = MXC.toJson(data);
		if(json.code=='1'){
			location.href= "{:U('Wap/Users/login')}";
		}else{
			$("#errmsg").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + json.info);
		}
   });
}
</script>
</body>
</html>
